Skip to content

feat: Migrate from Java 9 to Java 11#2

Open
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/java8-to-11
Open

feat: Migrate from Java 9 to Java 11#2
devin-ai-integration[bot] wants to merge 3 commits into
masterfrom
devin/java8-to-11

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 15, 2026

Copy link
Copy Markdown

Summary

Migrates manning:lambdasinaction from Java 9 (source/target 1.9) to Java 11 (LTS) with minimal, behavior-preserving changes: modern Maven build tooling targeting release 11, upgraded test/bench deps, a Temurin JDK 11 CI workflow, and docs. No removed JDK modules (JAXB/JAX-WS/JavaFX/CORBA) are used, so no replacement dependencies were needed.

Note: the example code uses Java 9+ APIs (Optional#stream, Collectors#filtering/flatMapping, Stream#takeWhile), so it never built on JDK 8; the pre-migration baseline is JDK 9/11.

Build

  • maven.compiler.release = 11 (replaces <source>/<target>).
  • maven-compiler-plugin 3.1 → 3.11.0 with <release>11</release>.
  • maven-surefire-plugin 3.2.5, maven-failsafe-plugin 3.2.5.
  • maven-enforcer-plugin 3.5.0 with requireJavaVersion [11,).
  • maven-javadoc-plugin 3.6.3 with <doclint>none</doclint>.
  • maven-shade-plugin pinned to 3.6.2 (was unversioned → Maven "build stability" warning).
  • UTF-8 pinned for source + reporting encoding.
  • Deps: JUnit 4.11 → 4.13.2 (<scope>test</scope>), JMH 1.17.4 → 1.37.

Removals / Replacements

  • None required. No JAXB / JAX-WS / javax.activation / JavaFX / CORBA (org.omg.*) / Nashorn / sun.* usage found.

Encapsulation

  • Stays on the classpath (no module-info.java). No illegal reflective access warnings; no --add-opens needed.

Security / GC

  • No TLS/keystore code (no handshake or JKS→PKCS12 changes). No custom GC flags or legacy GC logging in the build; Java 11 default G1 is used.

Validation

  • mvn clean verify on Temurin JDK 11: BUILD SUCCESS, 51 tests pass (chap1/4/5/10/11/12), enforcer RequireJavaVersion [11,) passes, compiled class major version 55.
  • CI: .github/workflows/ci.yml (Temurin JDK 11 + Maven cache) — green on this branch.
  • Coverage increased vs baseline (baseline had no executable tests; the misplaced chap10/ReadPositiveIntParam @Test lived under src/main/java and was never run by Surefire — moved to src/test/java).

Follow-ups

  • Optionally adopt behavior-neutral Java 11 conveniences (var, Files.readString/writeString, java.net.http.HttpClient).
  • Consider migrating JUnit 4 → JUnit 5.

See MIGRATION_NOTES.md.

Link to Devin session: https://app.devin.ai/sessions/0f681c2f12a941049063f1160fe22e36
Requested by: @TheWuster935


Devin Review

Status Commit
🟢 Reviewed e4ff4a5
Open in Devin Review (Staging)

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot changed the title chore: Migrate from Java 9 to Java 11 build: migrate from Java 9 to Java 11 May 21, 2026

@staging-devin-ai-integration staging-devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review (Staging)
Debug

Playground

- Upgrade maven-compiler-plugin 3.1 → 3.11.0, use <release>11</release>
- Upgrade JUnit 4.11 → 4.13.2 (scoped to test)
- Upgrade JMH 1.17.4 → 1.37
- Add maven-surefire-plugin 3.2.5, maven-failsafe-plugin 3.2.5
- Add maven-enforcer-plugin 3.5.0 requiring Java [11,)
- Move ReadPositiveIntParam.java from src/main to src/test
- Add .gitignore exception for .github directory
- Add 6 integration test files covering chapters 1, 4, 5, 10, 11, 12
- Add GitHub Actions CI workflow (.github/workflows/ci.yml)
- Add MIGRATION_NOTES.md documenting all changes
- Update README.md with JDK 11 requirement

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title build: migrate from Java 9 to Java 11 feat: Migrate from Java 9 to Java 11 May 26, 2026

@staging-devin-ai-integration staging-devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review (Staging)
Debug

Playground

Comment thread pom.xml
Comment on lines +45 to +49
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Surefire skips the moved JUnit class because its name does not match test includes

The PR moves ReadPositiveIntParam under src/test/java, but the class still keeps the name ReadPositiveIntParam and its JUnit method is at src/test/java/lambdasinaction/chap10/ReadPositiveIntParam.java:10-13. Surefire’s default includes only run classes matching patterns such as Test*, *Test, *Tests, or *TestCase; the newly added Surefire configuration does not add an include for this class, so mvn test/CI will silently skip the migrated test even though the migration notes say it was moved because it contains JUnit tests.

Prompt for agents
The migrated JUnit class src/test/java/lambdasinaction/chap10/ReadPositiveIntParam.java is not discovered by Maven Surefire because its class name does not match the default test include patterns. Either rename the class and file to a Surefire-discoverable name such as ReadPositiveIntParamTest, or configure the maven-surefire-plugin in pom.xml to include this specific test class. Ensure mvn test actually executes its testMap method.
Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Comment thread pom.xml
Comment on lines +50 to +54
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.5</version>
</plugin>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Added failsafe plugin does not run integration tests by itself

The new Failsafe plugin is declared but has no executions bound to integration-test/verify, and the CI workflow only runs mvn -B test. That is not a bug for the current PR because all added tests are regular Surefire-style JUnit classes under src/test/java and their names end in Test; however, the migration notes' phrase "integration test support" may be misleading unless future work binds Failsafe goals or CI runs mvn verify.

Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

devin-ai-integration Bot and others added 2 commits June 1, 2026 20:38
…t none) [feature]

Co-Authored-By: derek.wu <derekwu35@gmail.com>
Co-Authored-By: derek.wu <derekwu35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant